import request from '/@/api/request'
/** 需求大厅列表-分页 */
export const getRequireList = (data: RequirementTypes.IRequest) => {
  return request.post<IPaginationResponse<RequirementTypes.IResponse[]>>('/business/datamarket/platformRequire/platformRequirePage', data)
}

/** 需求大厅详情 */
export const getRequireDetail = (data: RequirementTypes.DetailIRequest) => {
  return request.get<IBaseResponse<RequirementTypes.DetailIResponse>>('/business/datamarket/platformRequire/getPlatformRequireById', data)
}

/** 字典列表 */
export const getDictList = (data: RequirementTypes.DictRequest) => {
  return request.get<IBaseResponse<RequirementTypes.DictResponse>>('/business/datamarket/common/allDicts', data)
}

/** 需求-发布 */
export const saveRequire = (data: RequirementTypes.SaveRequest) => {
  return request.post<IPaginationResponse<string>>('/business/datamarket/platformRequire/savePlatformRequire', data)
}

/** 需求上架、下架  */
export const editStateRequire = (data: RequirementTypes.DetailIRequest) => {
  return request.post<IPaginationResponse<string>>('/business/datamarket/platformRequire/upOrDown', data)
}

/** 需求单列表-分页 */
export const getCustomerRequireList = (data: RequirementTypes.IRequest) => {
  return request.post<IPaginationResponse<RequirementTypes.IResponse[]>>('/business/datamarket/customerRequire/customerRequirePage', data)
}

/** 需求单列表 */
export const getCustomerRequireData = () => {
  return request.get<IBaseResponse<RequirementTypes.IResponse[]>>('/business/datamarket/customerRequire/customerRequireList')
}

/** 需求单详情 */
export const getCustomerRequireDetail = (data: RequirementTypes.DetailIRequest) => {
  return request.get<IBaseResponse<RequirementTypes.CustomerDetailResponse>>('/business/datamarket/customerRequire/getCustomerRequireById', data)
}

/** 参与需求列表-分页 */
export const getAttendRequireData = (data: RequirementTypes.AttendRequest) => {
  return request.post<IPaginationResponse<RequirementTypes.AttendResponse[]>>('/business/datamarket/requireParticipate/requireParticipatePage', data)
}

/** 参与需求详情 */
export const getAttendRequireDetail = (data: RequirementTypes.DetailIRequest) => {
  return request.get<IBaseResponse<RequirementTypes.AttendDetailResponse>>('/business/datamarket/requireParticipate/getRequireParticipateById', data)
}

/** 上传文件 */
export const uploadFileList = (data: RequirementTypes.UploadRequest) => {
  return request.postFormDataProxy('/zeus/standard/dc-file/addReturnOneId', data)
}

/** 预览非结构化文件接口 */
export const previewFile = (data: RequirementTypes.DetailIRequest) => {
  return request.postFormDataProxy('/zeus/standard/dc-file/unstructuredPreviewDownload', data)
}

/** 预览结构化文件接口 */
export const previewStructuredFile = (data: RequirementTypes.DetailIRequest) => {
  return request.postFormDataProxy('/zeus/standard/dc-file/structuredFilePreview', data)
}

/** 批次导出 */
export const downloadFile = (data: RequirementTypes.DetailIRequest) => {
  return request.downTxt<IBaseResponse<ExportBatchTypes.IResponse>>('/zeus/standard/dc-file/downloadByOneId', data)
}

/** 审核需求参与 */
export const approveRequire = (data: RequirementTypes.ApproveRequest) => {
  return request.post<UploadFileResponse<string>>('/business/datamarket/requireParticipate/approve', data)
}
